#include <bits/stdc++.h>
using namespace std;
const int N=1e5+50;
typedef long long ll;
char a[N],b[N];
int n;
int main(void){
    //ba
    ll zeze=0;
    ll zeon=0;
    ll onze=0;
    ll onon=0;
    scanf("%d",&n);
    scanf("%s",a);
    scanf("%s",b);
    for(int i=0;i<n;i++){
        if(a[i]=='1'){
            if(b[i]=='1'){
                onon++;
            }else{
                zeon++;
            }
        }else{
            if(b[i]=='1'){
                onze++;
            }else{
                zeze++;
            }
        }
    }
    ll ans=onon*zeze+onze*zeon+zeze*zeon;
    printf("%lld\n",ans);
    return 0;
}